/*
 * @Author: chenxi
 * @Date: 2024-11-12 23:57:13
 * @LastEditors: chenxi
 * @LastEditTime: 2024-11-13 00:28:57
 * @FilePath: c:\Users\chenx\Desktop\Code\GD32\epd\Epaper\EPD\Display_EPD_W21.h
 * @Description: 
 * Copyright 2024 OBKoro1, All Rights Reserved. 
 * 2024-11-12 23:57:13
 */
#ifndef _DISPLAY_EPD_W21_H_
#define _DISPLAY_EPD_W21_H_

#define EPD_37

#ifndef EPD_37

#define EPD_WIDTH 416
#define EPD_HEIGHT 240
#define EPD_ARRAY EPD_WIDTH *EPD_HEIGHT / 8

// Full screen update display
void EPD_HW_Init(void);
void EPD_HW_Init_180(void);
void EPD_WhiteScreen_ALL(const unsigned char *datasBW, const unsigned char *datasRW);
void EPD_WhiteScreen_White(void);
void EPD_WhiteScreen_Black(void);
void EPD_DeepSleep(void);
// Partial update display
void EPD_SetRAMValue_BaseMap(const unsigned char *datasBW, const unsigned char *datasRW);
void EPD_Dis_PartAll(const unsigned char *datas);
void EPD_Dis_Part(unsigned int x_start, unsigned int y_start, const unsigned char *datas, unsigned int PART_COLUMN, unsigned int PART_LINE);
// Num display
void EPD_Dis_Part_Num(unsigned int x_startA, unsigned int y_startA, const unsigned char *datasA,
					  unsigned int x_startB, unsigned int y_startB, const unsigned char *datasB,
					  unsigned int x_startC, unsigned int y_startC, const unsigned char *datasC,
					  unsigned int x_startD, unsigned int y_startD, const unsigned char *datasD,
					  unsigned int PART_COLUMN, unsigned int PART_LINE);

// GUI display
void EPD_HW_Init_GUI(void);
void EPD_Display(unsigned char *Image);
void EPD_Display_BW(unsigned char *Image);
void EPD_Display_R(unsigned char *Image);
// Fast full screen update display
void EPD_HW_Init_Fast(void);
void EPD_WhiteScreen_ALL_Fast(const unsigned char *datasBW, const unsigned char *datasRW);
void EPD_WhiteScreen_White_Fast(void);

            
void Display_All_Yellow(void);
void PIC_display (const unsigned char* picData);

#endif

#ifdef EPD_37

#define EPD_WIDTH   240 
#define EPD_HEIGHT  416
#define EPD_ARRAY  EPD_WIDTH*EPD_HEIGHT/8  


//Full screen refresh display
void EPD_Init(void); 
void EPD_Init_180(void);	
void EPD_WhiteScreen_ALL(const unsigned char *datasBW,const unsigned char *datasRW);
void EPD_WhiteScreen_White(void);
void EPD_WhiteScreen_Black(void);
void EPD_DeepSleep(void);
//Partial refresh display 
void EPD_Init_Part(void);
void EPD_SetRAMValue_BaseMap(const unsigned char * datasBW,const unsigned char * datasRW);
void EPD_Dis_PartAll(const unsigned char * datas);
void EPD_Dis_Part(unsigned int x_start,unsigned int y_start,const unsigned char * datas,unsigned int PART_COLUMN,unsigned int PART_LINE);
void EPD_Dis_Part_Time(unsigned int x_start,unsigned int y_start,
	                      const unsigned char * datas_A,const unsigned char * datas_B,
												const unsigned char * datas_C,const unsigned char * datas_D,const unsigned char * datas_E,
                        unsigned char num,unsigned int PART_COLUMN,unsigned int PART_LINE);				
void EPD_Dis_Part_Num2(unsigned int x_start,unsigned int y_start,
	                      const unsigned char * datas_A,const unsigned char * datas_B,
                        unsigned char num,unsigned int PART_COLUMN,unsigned int PART_LINE);		
void EPD_Dis_Part_Num3(unsigned int x_start,unsigned int y_start,
	                      const unsigned char * datas_A,const unsigned char * datas_B,
                        unsigned char num,unsigned int PART_COLUMN,unsigned int PART_LINE);													
//Fast refresh display
void EPD_Init_Fast(void);
void EPD_WhiteScreen_ALL_Fast(const unsigned char *datas);   

#endif

#endif
